import request from "../utils/axios"

//1.2 文章列表展现
export function getCategoryList() {
    let url = '/category/getCategory'
    return request.get(url)

}
//4.1 分类列表
export const getCategoryByPage=(page,limit)=>{
    let url = `/category/findCategoryByPage?page=${page}&limit=${limit}`
    return request.get(url)
}
//4.2 根据名称查询分类信息
export const getCategoryByName=(cname)=>{
    let url = `/category/findCategoryByName/${cname}`
    return request.get(url)
}
//4.3 文章分类新增
export const saveCategory=(category)=>{
    let url = `/category/saveCategory`
    return request.post(url,category)
}
//4.4 文章分类修改
export const updateCategory= (category) =>{
    let url = `/category/updateCategory`
    return request.put(url,category)
}
//4.5 文章分类删除
export const deleteCategoryById = (cid)=>{
    let url = `/category/deleteCategoryById?id=${cid}`
    return request.delete(url)
}

